package com.bds.tjj.utils;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;

public class SpringContextUtil {

	private static ApplicationContext context;

	private SpringContextUtil() {
	}

	public static void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		context = applicationContext;
	}

	public static <T> T getBean(String name, Class<T> aClass) {
		return context.getBean(name, aClass);
	}

}
